// import {Link} from 'umi';
// import withBreadcrumbs from 'react-router-breadcrumbs-hoc';
// import { Breadcrumb, Badge, Icon } from 'antd';

// // 更多配置请移步 https://github.com/icd2k3/react-router-breadcrumbs-hoc
// const routes = [{ path: '/', breadcrumb: '首页' }];

// const Breadcrumbs = ({ data }) => {
//   console.log(data,'eeeee');

//   if (data && Array.isArray(data)) {
//     const AntdBreadcrumb = withBreadcrumbs(data)(({ breadcrumbs }) => {
//       return (
//         <Breadcrumb separator={<Icon type="double-right" />} classNames="spread">
//           {breadcrumbs.map((breadcrumb, index) => (
//             <Breadcrumb.Item key={breadcrumb.key}>
//                        {
//       console.log(breadcrumb,'eeeee')

//           }
//               {breadcrumbs.length - 1 === index ? (
//                 <Badge status="processing" text={breadcrumb} />
//               ) : (
//                 <Link
//                   to={{
//                     pathname: breadcrumb.match.url,
//                     state: breadcrumb.match.params ? breadcrumb.match.params : {},
//                     query: breadcrumb.location.query ? breadcrumb.location.query : {},
//                   }}
//                 >
//                   {breadcrumb}
//                 </Link>
//               )}
//             </Breadcrumb.Item>
//           ))}
//         </Breadcrumb>
//       );
//     });
//     return <AntdBreadcrumb />;
//   }
//   const DefaultBreadcrumb = withBreadcrumbs(routes)(({ breadcrumbs }) => (
//     <div>
//       {breadcrumbs.map((breadcrumb, index) => (
//         <span key={breadcrumb.key}>
//           <Link
//             to={{
//               pathname: breadcrumb.props.match.url,
//               state: breadcrumb.props.match.params ? breadcrumb.props.match.params : {},
//               query: breadcrumb.props.location.query ? breadcrumb.props.location.query : {},
//             }}
//           >
//             {breadcrumb}
//           </Link>
//           {index < breadcrumbs.length - 1 && <i> / </i>}
//         </span>
//       ))}
//     </div>
//   ));
//   return <DefaultBreadcrumb />;
// };

// export default Breadcrumbs;

import withBreadcrumbs from 'react-router-breadcrumbs-hoc';
import { Link } from 'umi';
import RoutersArray from '@/utils/routes';
import { Breadcrumb, Badge, Icon } from 'antd';

const routes = [
  { path: '/', breadcrumb: '' },
  { path: '/blog/custom/', breadcrumb: '' },
  { path: '/custom', breadcrumb: '' },

  { path: '/blog', breadcrumb: '首页' },
  { path: '/blog/custom', breadcrumb: '文章列表' },
  { path: '/blog/custom/overview', breadcrumb: '预览' },
  { path: '/blog/custom/article', breadcrumb: '文章列表' },
];
// map, render, and wrap your breadcrumb components however you want.
const Breadcrumbs = ({ breadcrumbs }) => (
  <div>
    <Breadcrumb separator={<Icon type="double-right" />} classNames="spread">
      {breadcrumbs.map(({ match, breadcrumb }) => (
        <Breadcrumb.Item key={breadcrumb.key}>
          <span key={match.url}>
            <Link to={match.url}>{breadcrumb}</Link>
          </span>
        </Breadcrumb.Item>
      ))}
    </Breadcrumb>
  </div>
);

export default withBreadcrumbs(routes)(Breadcrumbs);
